//
//  BottomView.m
//  兼职页面
//
//  Created by kuiyuan liang on 2021/5/23.
//

#import "BottomView.h"
#import "CommonUtil.h"

@interface BottomView()

@property (strong, nonatomic) UIButton * indexBtn;
@property (strong, nonatomic) UIButton * addBtn;

@end

@implementation BottomView


-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {

        [self addSubview:self.indexBtn];
        [self addSubview:self.addBtn];
        
        
    }
    return self;
}


- (void)indexBtnClick:(UIButton *)sender{
    NSLog(@"%@",sender.titleLabel.text);
}
- (void)addBtnClick:(UIButton *)sender{
    NSLog(@"%@",sender.titleLabel.text);
}



#pragma mark - lazy
-(UIButton *)indexBtn{
    if (!_indexBtn) {
        _indexBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_indexBtn setTitle:@"34期" forState:UIControlStateNormal];
        [_indexBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _indexBtn.titleLabel.font = [UIFont boldSystemFontOfSize:AD(20)];
        _indexBtn.layer.cornerRadius = AD(3);
        _indexBtn.clipsToBounds = YES;
        _indexBtn.backgroundColor = RGB(87.0, 172.0, 211.0);
        _indexBtn.frame = CGRectMake(AD(15), AD(10), (SCREEN_WIDTH-AD(45))/2, AD(40));
        [_indexBtn addTarget:self action:@selector(indexBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _indexBtn;
}

-(UIButton *)addBtn{
    if (!_addBtn) {
        _addBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_addBtn setTitle:@"添加" forState:UIControlStateNormal];
        [_addBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _addBtn.titleLabel.font = [UIFont boldSystemFontOfSize:AD(20)];
        _addBtn.layer.cornerRadius = AD(3);
        _addBtn.clipsToBounds = YES;
        _addBtn.backgroundColor = RGB(236.0,92.0, 77.0);
        _addBtn.frame = CGRectMake(_indexBtn.right + AD(15), AD(10), _indexBtn.width, _indexBtn.height);
        [_addBtn addTarget:self action:@selector(addBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _addBtn;
}

@end
